/**
 * Description: RegisterInfoTypeDAOImpl.java
 * Copyright (c) 2008-2009  Neo. 
 * All Rights Reserved.
 * @version 1.0  Apr 2, 2009 2:23:40 PM 李萌（neolimeng@gmail.com）created
 */
package org.paradise.dms.dao.impl;

import java.util.List;

import org.paradise.dms.pojo.RegisterInfoType;
import org.springframework.stereotype.Service;

import com.dheaven.framework.dao.BaseHibernateDao;
import com.dheaven.framework.dao.DaoException;

/**
 * Description: Copyright (c) 2008-2009 Neo. All Rights Reserved.
 * 
 * @version 1.0 Apr 2, 2009 2:23:40 PM 李萌（neolimeng@gmail.com）created
 */
@Service
public class RegisterInfoTypeDAOImpl extends BaseHibernateDao<RegisterInfoType> {
	public void insertRegisterInfoType(RegisterInfoType rit) throws DaoException {
		this.create(rit);
	}

	public void updateRegisterInfoType(RegisterInfoType rit) throws DaoException {
		this.update(rit);
	}

	public void deleteRegisterInfoType(int registerinfotypeid) throws DaoException {
		RegisterInfoType rit = new RegisterInfoType();
		rit.setRegisterinfotypeid(registerinfotypeid);
		this.delete(rit);
	}

	public RegisterInfoType getRegisterInfoType(int registerinfotypeid) throws DaoException {
		return (RegisterInfoType) this.find("from RegisterInfoType where registerinfotypeid=? and registerinfotypeind=1", new Object[] { registerinfotypeid }).get(0);
	}

	@SuppressWarnings("unchecked")
	public List<RegisterInfoType> getAllRegisterInfoType() {
		return this.find("from RegisterInfoType where registerinfotypeind=1");
	}
}
